<template>
	<view  class="order-detail">
		<u-cell-item title="美食商品信息" :arrow="false"></u-cell-item>
		<view class="o-d-base">
			<view class="u-flex">
				<view class="u-flex-1">
					商品主图：
				</view>
				<u-image style="border-radius: 10rpx;" :src="foodOrderProductVO.productImageUrl" width="56rpx" height="54rpx" mode="aspectFit">
				</u-image>
			</view>
			<view class="">
				商品货号：{{foodOrderProductVO.productCode}}
			</view>
			<view class="">
				商品名称：{{foodOrderProductVO.productName}}
			</view>
			<view class="">商品数量：{{foodOrderProductVO.productUnit}}</view>
			<view class="">商品单价：{{foodOrderProductVO.productUnitPrice}}</view>
			<view class="">糖果抵扣价：{{foodOrderProductVO.sweetDeductPrice}}</view>
		</view>
		<u-gap height="14" bg-color="#F0F0F0"></u-gap>
		<u-cell-item title="美食订单信息" :arrow="false"></u-cell-item>
		<view class="o-d-base">
			<view class="">订单号：{{orderDetailes.orderNo}}</view>
			<view class="">下单人手机号：{{orderDetailes.userPhone}}</view>
			<view class="">门店名称：{{orderDetailes.merchantName}}</view>
			<view class="u-flex">
				<view class="u-flex-1">
					二维码：
				</view>
				<u-image style="border-radius: 10rpx;" :src="orderDetailes.qrCode" width="56rpx" height="54rpx" mode="aspectFit">
				</u-image>
			</view>
			<view class="">核销码：{{orderDetailes.writeOffCode}}</view>
			<view class="">数量：{{orderDetailes.buyNumber}}</view>
			<view class="">优惠金额：{{orderDetailes.discountAmount}}</view>
			<view class="">总金额：{{orderDetailes.totalAmount}}</view>
			<view class="">实际支付金额：{{orderDetailes.actualPayAmount}}</view>
			<view class="">实际支付糖果：{{orderDetailes.actualPaySweet}}</view>
			<view class="">糖果平均价：{{orderDetailes.sweetAveragePrice}}</view>
			<view class="">糖果抵扣金额：{{orderDetailes.sweetDeductPrice}}</view>
			<view class="">下单时间：{{orderDetailes.orderTime}}</view>
			<view class="">支付时间：{{orderDetailes.paymentTime}}</view>
			<view class="">不消费订单过期时间：{{orderDetailes.expireTime}}</view>
			<view class="" v-if="orderDetailes.cancelTime">订单取消时间：{{orderDetailes.cancelTime}}</view>
			<view class="" v-if="orderDetailes.cancelReason">订单取消原因：{{orderDetailes.cancelReason}}</view>
			<view class="">订单备注（买家）：{{orderDetailes.memo  || '无'}}</view>
			<view class="">订单备注（卖家）：{{orderDetailes.orderComment  || '无'}}</view>
			<view class="">支付方式：<text class="primary">{{PAYMENTMETHOD[orderDetailes.paymentMethod]}}</text> </view>
			<view class="">支付渠道：<text class="primary">{{PRICEPAYTYPE[orderDetailes.pricePayType]}}</text></view>
			<view class="">订单状态：{{ORDERSTATUS[orderDetailes.orderStatus]}}</view>
			<view class="">结算状态：<text class="primary">{{SETTLESTATUS[orderDetailes.settleStatus]}}</text></view>
			<view class="">退款进度：{{orderDetailes.refundDescribe || '无'}}</view>
		</view>
	</view>
</template>

<script>
	import dataJs from './data.js'
	export default {
		data() {
			return {
				orderNo: '',
				orderDetailes: {},
				foodOrderProductVO: {},
				PAYMENTMETHOD: dataJs.PAYMENTMETHOD,
				PRICEPAYTYPE: dataJs.PRICEPAYTYPE,
				ORDERSTATUS: dataJs.ORDERSTATUS,
				SETTLESTATUS: dataJs.SETTLESTATUS,
			}
		},
		onLoad(option) {
			this.orderNo = option.id;
			this.getDetail()
		},
		methods: {
			getDetail() {
				this.$u.offlineApi.foodOrderDetails({
					id: this.orderNo,
				}).then(res=>{
					if(res.code == 0){
						this.orderDetailes = res.data;
						this.foodOrderProductVO = res.data ? res.data.foodOrderProductVO : {}
					}else{
						uni.showToast({
							icon:'none',
							title: res.msg
						});
					}
				})
			}
		}
	}
</script>

<style scoped>
.primary {
	color: #357CD4;
}
.hui {
	color: #999999;
}
.o-d-base {
	padding: 25rpx 30rpx 20rpx 30rpx;
	font-size: 26rpx;
	line-height: 44rpx;
}
.card-img {
	margin-right: 30rpx;
	width: 166rpx;
	height: 166rpx;
	border-radius: 10rpx;
	font-size: 24rpx;
}
.o-d-card {
	padding: 23rpx 30rpx 20rpx 30rpx;
	font-size: 24rpx;
}
.o-d-card-info {
	padding: 0 30rpx 10rpx 30rpx;
	font-size: 24rpx;
}
</style>
